<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>控制台</title>
<jsp:include page="../header.jsp"></jsp:include>
<script type="text/javascript">
	var uid = 0;
</script>
<style type="text/css">
.backcolor{
background-color: #5cacee;
}

</style>
</head>

<body>
	<div class="contextBox">
		<form id="itemsForm" action="" method=get>
								<table class="TableList" width="100%" align="center">
		                          <tbody><tr class="TableContent">
										<td align="left"><span>用户名称：${mapManager['manger']}</span></td>
										<input type="hidden" name="id" id="id" value="${mapManager['id']}" />
										<input type="hidden" name="pwd" id="pwd" value="${mapManager['pwd']}" />
										<input type="hidden" name="mobiles" id="mobiles" value="${mapManager['mobile']}" />	
									</tr>
									<tr>
										<td align="left"><span class="redtxt">密码： </span> <input
											type="text" name="password" class="password"
											value="${mapManager['pwd']}"></td>
									</tr>
									<tr>
										<td align="left"><span class="redtxt">手机号： </span> <input
											type="text" name="mobile" class="mobile" value="${mapManager['mobile']}"></td>
									</tr>
									<tr>
										<td align="left"><span class="redtxt">登录状态： </span> <select
											name="isFincing" onchange="">
												<c:choose>
													<c:when test="${mapManager['islogin'] == 1}">
														<option value="1" selected="selected">允许登录</option>
													</c:when>
													<c:otherwise>
														<option value="1">允许登录</option>
													</c:otherwise>
												</c:choose>
												<c:choose>
													<c:when test="${mapManager['islogin'] == 2}">
														<option value="2" selected="selected">不允许登录</option>
													</c:when>
													<c:otherwise>
														<option value="2">不允许登录</option>
													</c:otherwise>
												</c:choose>
										</select></td>

									</tr>
									<tr>
										<td align="left"><span class="redtxt">赋给权限： </span> <select
											id="roleID" name="roleID">
												<option value='0'>请选择</option>
												<c:forEach items="${nrList}" var="u">
													<option <c:if test='${roleID==u.keyI }'>selected</c:if>
														value="${u.keyI}">${u.valueX}</option>
												</c:forEach>
										</select></td>
									</tr>
								</table>
								<table width="100%" border="0" cellspacing="0" cellpadding="0">
									<td align="left"><input type="button" value="提交"
										class="btn btn-success" onclick="addform()"></td>
								</table>
							</form>
						</div>
		
	<script type="text/javascript">
	function addform(){
		$.ajax({ type : 'post',
					url : "<%=request.getContextPath()%>/supervise/getManagerU.do",
					data : $("#itemsForm").serialize(),
					success : function(data) {
						if (data == 1) {
							alert("修改成功");
						}else if(data=0){
							alert("用户插入失败");
						}else{
							alert("手机号已存在");
						}
					}
				});
	}
	</script>

</body>

</html>